import java.util.Scanner;

/*      一个字符串，【l，m】进行反转。存在a，b，c，d，（1<=a<b<c<d<arr.length），
        字符串角标1起始，将【a,b】进行反转，【c,d】进行反转，
        若最后得到的字符串和原字符串一样，则返回YES和a,b,c,d的值（返回其中一组即可），反之返回NO
*/
public class Main {
    // public static void main(String[] args) {
    //     Scanner in = new Scanner(System.in);
    //     // 注意 hasNext 和 hasNextLine 的区别
    //     while (in.hasNextInt()) { // 注意 while 处理多个 case
    //         int a = in.nextInt();
    //         int b = in.nextInt();
    //         System.out.println(a + b);
    //     }
    // }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String str = scanner.next();
        while (str.length() < n) {
            str += ' ';
            str += scanner.next();
        }
        int a = 1, b = 0, c = 0, d = 0;
        int count = 0;
        String str1 = "";
        StringBuilder strb = new StringBuilder();
        for (int j = 1; j < n; j++) {
            for (int i = j; i < n; i++) {
                strb.append(str.charAt(i));
                StringBuilder strc = strb.reverse();
                if (strc.equals(strb)) {
                    b = i + 1;
                    count++;
                    str1 += strb.toString();
                    break;
                }
            }
            if (b != 0) {
                break;
            }
        }
        for (int j = b+1; j < n; j++) {
            for (int i = j; i < n; i++) {
                c = b + 1;
                strb.append(str.charAt(i));
                StringBuilder strc = strb.reverse();
                if (strc.equals(strb)) {
                    d = i + 1;
                    count++;
                    str1 += strb.toString();
                    break;
                }
            }
            if (d != 0) {
                break;
            }
        }
        if (count == 2 && str1.equals(str)) {
            System.out.println("YES");
            System.out.print(a + " " + b + " " + c + " " + d);
        } else {
            System.out.println("NO");
        }
    }
}